package com.itany.corejava.day02;

public class Test1 {

    static int k=30;

    public static void main(String[] args) {

        //变量的声明
        int i;
        //错，变量必须先初始化，后使用
        // System.out.println("i = " + i);
        //变量的初始化
        i=10;
        System.out.println("i = " + i);

        {
            //变量的声明并初始化
            int j=20;
            System.out.println("i = " + i);

            System.out.println("j = " + j);

            System.out.println("k = " + k);

        }

        System.out.println("i = " + i);
        // System.out.println("j = " + j);

        //错，变量不能重复定义
        // int i=30;
        i=30;
        System.out.println("i = " + i);
    }

    {
        // System.out.println("i = " + i);
    }
}
